<?php
namespace app\index\controller;

use think\Config;
use think\Session;

class _Abstract extends \think\Controller
{
	public function _initialize()
	{
		parent::_initialize();
		// 初始化 session
		$hash = trim($this->request->get('hash'));
		$config = Config::get('session');
		if (26 == strlen($hash)) {			
			$config['id'] = $hash;
		}
		Session::init($config);
		// 控制器视图调用 auth
		$this->auth = Session::get('auth');
		$this->assign('auth', $this->auth);
	}
}
